<?php
    include 'kahlua.ini';
    include 'classes/utils/smarty_connect.php';
    include_once 'classes/handlers/notasHandler.php';
    include_once 'classes/handlers/videosHandler.php';
    include_once 'classes/handlers/albumsHandler.php';
    include_once 'classes/handlers/ayNoMemesHandler.php';
    include_once 'classes/handlers/encuestasHandler.php';
    include_once 'classes/handlers/asilotwiteoHandler.php';
    include_once 'classes/handlers/masimagenHandler.php';
    include_once "classes/handlers/seccionesHandler.php";

    $notasH = new NotasHandler();
    $videosH = new videosHandler();
    $albumsH = new albumsHandler();
    $aynomemesH = new AyNoMemesHandler();
    $encuestasH = new encuestasHandler();
    $asilotwiteoH = new asilotwiteoHandler();
    $masimagenH = new MasImagenHandler();
    $seccionH = new SeccionesHandler();

    $arrMes = array(
        "1" => "Ene",
        "2" => "Feb",
        "3" => "Mar",
        "4" => "Abr",
        "5" => "May",
        "6" => "Jun",
        "7" => "Jul",
        "8" => "Ago",
        "9" => "Sep",
        "10" => "Oct",
        "11" => "Nov",
        "12" => "Dic"
    );

    $ano = isset($_POST["ano"]) ? $_POST["ano"] : date("Y");
    $mes = isset($_POST["mes"]) ? $_POST["mes"] : date("m");

    $columnas = $notasH::getColumnasPorFecha($mes, $ano);
    //echo "<pre>"; print_r($columnas); exit();

//right & left sidebars, footer & header
    $colRodrigo = $notasH::getColRodrigo();
    $topVideo = $videosH::getTopVideo();
    $masTiempo = $notasH::getMasTiempo();
    $masVistas = $notasH::getMasVistas();
    $masComentadas = $notasH::getMasComentadas();
    $enResumen = $notasH::getEnResumenFP();
    $queFreson = $albumsH::getTop3Albums('queFreson');
    $ayNoMemes = $aynomemesH::getTopMeme();
    $esquinaNaranja = $notasH::getEsquinaNaranja();
    $fresonPolitico = $albumsH::getTop3Albums('fresonPolitico');
    $encuesta = $encuestasH::getEncuesta();
    $queGuau = $albumsH::getTop3Albums('queGuau');
    $gadgets = $notasH::getGadgets();
    $asilotwiteo = $asilotwiteoH->getTop();
    $masImagen = $masimagenH::getTopMasImagen();

    $smarty = new smarty_connect;
    $smarty->template_dir = '/projects/masmedio2013/templates';

    $smarty->assign('colRodrigo', $colRodrigo[0]);
    $smarty->assign('topVideo', $topVideo[0]);
    $smarty->assign('masTiempo', $masTiempo[0]);
    $smarty->assign('masVistas', $masVistas);
    $smarty->assign('masComentadas', $masComentadas);
    $smarty->assign('enResumen', $enResumen);
    $smarty->assign('queFreson', $queFreson);
    $smarty->assign('ayNoMemes', $ayNoMemes[0]);
    $smarty->assign('esquinaNaranja', $esquinaNaranja);
    $smarty->assign('fresonPolitico', $fresonPolitico);
    $smarty->assign('encuesta', $encuesta[0]);
    $smarty->assign('queGuau', $queGuau);
    $smarty->assign('gadgets', $gadgets);
    $smarty->assign('asilotwiteo', $asilotwiteo[0]);
    $smarty->assign('masImagen', $masImagen);

    $smarty->assign('arrMes', $arrMes);
    $smarty->assign('columnas', $columnas);

    $smarty->display('/projects/masmedio2013/templates/columnas.tpl');